package ua.com.jpy.services.product;

import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ua.com.jpy.entity.IEntity;
import ua.com.jpy.entity.catagory.product.dao.IProductDao;
import ua.com.jpy.services.basic.AJpyBasicService;

/**
 * @author LSD25
 *
 */
@Service
public class ProductService extends AJpyBasicService implements IProductService {
	
	@Autowired
	private IProductDao productDao;
	
	@Override
	public IEntity getOrCreate(IEntity entity, ObjectId id) {
		return productDao.getOrCreate(entity, id);
	}
	
	@Override
	public boolean delete(IEntity entityFoDelete, ObjectId id) {
		return productDao.delete(entityFoDelete, id);
	}
	
	@Override
	public boolean update(IEntity entityForUpdate, ObjectId id) {
		return productDao.update(entityForUpdate, id);
	}
	
}
